const db = require("./init-mysql");
const fs = require("fs");

module.exports = () => {
  let files = fs.readdirSync(__dirname);
  let jsFiles = files.filter((f) => {
    return f.endsWith("-model.js");
  });
  for (let f of jsFiles) {
    console.log(`import file ${f}...`);
    require(__dirname + "/" + f);
  }
  db.sync({ alter: true });
};
